<?php
/* @var $this MapviewController */

$this->breadcrumbs=array(
	'Guestbooks'=>array('index'),
	'Manage'=>array('guestbook/admin'),
	'Email Blast',
);
?>
<h1>These are the users that will receive the email anouncement</h1>
<?php //echo CHtml::link('Send Email Blast',array('emailBlast/sendEmail'));?>
<p>
	<table class="detail-view">
	<tr>
		<th>Name</th>
		<th>Email</th>
		<th>Contact Number</th>
	</tr>
	
	<?php
	$totalTo='';
	$i=1;
	foreach($contacts as $value){
		echo '<tr><td>'. $value->name .'</td><td>'. $value->email .'</td><td>'. $value->contact_number .'</td></tr>';
		if ($i==1) $totalTo =$value->email;
		else $totalTo = $totalTo. ',' .$value->email;
		$i++;
	}	
	//print_r($totalTo);exit;
	?>
	</table>
	
	<h1>Email Content</h1>
	
	<?php echo $this->renderPartial('_form', array('model'=>$model,'to'=>$totalTo)); ?>
</p>
